<template>
  <a-alert message="Success Text" type="success" />
  <p>{{ ass }}</p>
</template>

<script  setup>
let ass = []
let arr = [
  {
    id: 10,
    children: [
      {
        id: 30,
        children: [
          { id: 40 }
        ]
      }
    ]
  },
  {
    id: 20, children: [
      {
        id: 50,
        children: [
          { id: 60 }
        ]
      }]
  }
]
const deepAdd = (as, name, value) => {
  as.forEach(item => {
    console.log(item)
    if (item.children) {
      deepAdd(item.children, name, value)
    }
  })
  return as
}

ass = deepAdd(arr, 'connectId', 100)
</script>

<style scoped lang="scss"></style>
